home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------------------
- #
- # Program: Tutor3D™
- #
- # Copyright ©1991 Lincoln Lydick
- # All Rights Reserved.
- #
- #
-
- NOTES
- -----
- Include the following libraries:
- MacTraps
- SANE
-
- The initialization is in C, we use C declarations, and the event
- loop is in assembly.
-
- For an overall explanation of what's happening at each routine, see
- the THINK C code.
- -----------------------------------------------------------*/
-
- #include "SANE.h" /* for initialization only. */
-
- #define kCenterH 256 /* this is origin.h */
- #define kCenterV 171 /* this is origin.v */
- #define kMaxObjects 6 /* max num objects we draw */
- #define kAngleResolution 12 /* minutes per deqree (never 0) */
- #define kProjDistance 450 /* distance to projection plane */
- #define kLineToTrapNum 0xA891 /* trap num for _LineTo */
- #define kNotBWAlertNum 256 /* ALRT id for monitor bit depth > 1 */
-
- enum ObjectType {cube, pyramid}; /* we define two types of objects */
-
- typedef struct {short x, y, z;
- } Point3D; /* structure for a 3 dimensional pt. */
-
- typedef struct {
- Point3D pt3D;
- short angle, sine, cosine;
- } ViewerInfo; /* structure for viewer's position. */
-
- typedef struct {
- enum ObjectType objType;
- Point3D pt3D;
- short angle, halfWidth, height;
- Boolean rotates, moves;
- } ObjectInfo; /* structure for an object. */
-
- typedef short TrigTable[1];
-
- TrigTable *gTrigTable;
- ViewerInfo gViewer;
- ObjectInfo gObject[kMaxObjects];
- BitMap gBitMap;
- GrafPort gAnimationPort;
- Rect gVisRect;
- Point gVertex[8];
- Point3D gDelta;
- Ptr gLineToAddress;
- short gDiffRows;
-
- /************************************************************/
- /*
- /* Assign parameters to an object (a cube or pyramid).
- /*
- /************************************************************/
- static void NewObject(short index, enum ObjectType theType, short width, short height,
- Boolean rotates, Boolean moves, short x, short y, short z)
- {
- register ObjectInfo *obj;
-
- obj = &gObject[index];
- obj->objType = theType;
- obj->halfWidth = width/2;
- obj->height = height;
- obj->rotates = rotates;
- obj->moves = moves;
- obj->angle = 0;
- obj->pt3D.x = x;
- obj->pt3D.y = y;
- obj->pt3D.z = z;
- }
-
- /************************************************************/
- /*
- /* Initialize of all our globals, build the trig table, set up an offscreen buffer, create a new
- /* window, and initialize all the objects to be drawn.
- /*
- /************************************************************/
- static void Initialize(void)
- {
- WindowPtr gWindow;
- extended angle;
- short i;
-
- InitGraf(&thePort);
- InitFonts();
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs(0L);
- InitCursor();
- FlushEvents(everyEvent, 0);
- SetCursor(*GetCursor(crossCursor));
-
- if ((*(*GetMainDevice())->gdPMap)->pixelSize > 1)
- {
- InitCursor();
- StopAlert(kNotBWAlertNum, NULL); /* tell user to switch to B&W.*/
- ExitToShell();
- }
-
- gLineToAddress = (Ptr) NGetTrapAddress(kLineToTrapNum, ToolTrap);
- gLineToAddress = StripAddress(gLineToAddress);
-
- gTrigTable = (TrigTable*)NewPtr(((90*kAngleResolution)+1)*2);
- for (i = 0, angle = 0.00; i <= 90*kAngleResolution; i++, angle += 0.017453292/kAngleResolution)
- *gTrigTable[i] = sin(angle)*1000; /* save the value (x1000) in an array.*/
-
- /* give the viewer an initial direction and position…*/
- gViewer.angle = gViewer.sine = gViewer.pt3D.x = gViewer.pt3D.y = 0;
- gViewer.pt3D.z = 100;
- gViewer.cosine = 999;
-
- NewObject(0, cube, 120, 120, false, false, -150, 600, 0); /* create some objects…*/
- NewObject(1, cube, 300, 300, true, false, -40, 1100, 60);
- NewObject(2, cube, 40, 10, true, true, 0, 500, 0);
- NewObject(3, pyramid, 160, 160, false, false, 200, 700, 0);
- NewObject(4, pyramid, 80, -80, true, false, 200, 700, 240);
- NewObject(5, pyramid, 60, 60, false, false, -40, 1100, 0);
-
- SetRect(&gVisRect, -100, -100, 512+100, 342+100); /* visible bounds for objects.*/
- SetRect(&gBitMap.bounds, 0, 0, 512, 342);
- gBitMap.rowBytes = ((512+15)/16)*2;
- gBitMap.baseAddr = NewPtr(342*(((512+15)/16)*2)); /* allocate bit map*/
-
- gWindow = NewWindow(0L, &gBitMap.bounds, "\p", true, 2, (Ptr)-1, false, 0);
- gDiffRows = gWindow->portBits.rowBytes - gBitMap.rowBytes;
-
- OpenPort(&gAnimationPort); /* we draw to an offscreen buffer.*/
- SetPort(&gAnimationPort);
- SetPortBits(&gBitMap);
- PenPat(white);
- }
-
- /************************************************************/
- /*
- /* Here's the assembly. VERY IMPORTANT!! Several low memory globals are used
- /* and could cause serious problems on different or future macs. Also, a couple of
- /* numbers are "hard coded" and rely on others - not allowing for much flexibility.
- /* This is, however, not an example of how to program the 680x0 or proper ROM
- /* useage, but does show some ways to speed things up.
- /*
- /************************************************************/
- void main(void)
- { asm {
-
- ;------Start------
- ; The Main Event (loop). Cycle until the mouse button is pressed.
-
- jsr Initialize ; set up params…
- mainloop: jsr @_FillPortBlack ; fill the bitmap with black
- jsr @_CheckViewer ; get scoop on viewer
- jsr @_DrawObjects ; our drawing pipeline
- jsr @_DrawCrossHair ; simple crosshair
- jsr @_BitBlit ; copy it to the screen
- tst.b 0x172 ; MBState=$172, hardware mouse button state [byte] I-279
- bmi @mainloop ; if not, loop.
-
- moveq #0x0000000A, d0 ; mDownMask+keyDownMask, 0
- _FlushEvents ; flush em out of the queue
- _ExitToShell ; bye…
-
- ;------DrawCrossHair------
- ; Draw a crosshair at the center of the window.
- ;
- @_DrawCrossHair:
- move.l #0x00A10100, gAnimationPort.pnLoc ; ie., MoveTo(256, 161)
- move.l #0x00140000, -(SP) ; ie., 0, 20
- _Line
- move.l #0x00AB00F6, gAnimationPort.pnLoc ; 246, 171
- move.l #0x00000014, -(SP) ; 20, 0
- _Line
- rts
-
- ;------FillPortBlack------
- ; Replacement for FillRect(). Simply fills the bitmap
- ; with 0xFFFFFFFF (black) by moving 44 bytes per loop.
- ; Note: this map (512*342) can't be filled evenly so we
- ; tack on a little at the end.
-
- @_FillPortBlack:
- lea @elevenBlacks, a0
- movem.l (a0), d1-d7/a1-a4
- move.w #496, d0 ; 496 = (((length * width) / 32 bits) / 11 longs at a time)-1
- movea.l gBitMap.baseAddr, a0 ; ptr to the bitmap's data
- fillLoop: movem.l d1-d7/a1-a4, (a0) ; a fast fill…
- adda.l #44, a0 ; moved 44 bytes (11 * 4)
- dbra d0, @fillLoop ; loop
- movem.l d1-d5, (a0) ; last little bit cause bitmap's not an even MOD 44
- rts
-
- ;------BitBlit------
- ; Replacement for CopyBits(). Calculate the src and dst bitmap
- ; address, and the difference in rowbytes. The difference will
- ; be the amount to add to the dst bitmap (the screen) to move
- ; down a vertical row. We move 16 longs per horizontal
- ; scan line (16 * 32bits = 512) and 342 rows (height of map).
- ;
- ; This runs over 33% faster than CopyBits() since we know
- ; exactly what to "move" and how to calculate it. HOWEVER, it
- ; is a dangerous practice to copy directly to the screen and
- ; further tests should be performed for any serious application.
-
- @_BitBlit:
- _HideCursor ; don't want to interfere w/ cursor image
- movea.l gBitMap.baseAddr, a0 ; source bitmap ptr
- movea.l 0x824, a1 ; ScrnBase=$824, Screen base [pointer] I-473
- move.w #342-1, d0 ; 342 rows to transfer
- move.w gDiffRows, d1
- nextline: move.l (a0)+, (a1)+ ; first 32 bits of the 512
- move.l (a0)+, (a1)+ ; second, and so on…
- move.l (a0)+, (a1)+
- move.l (a0)+, (a1)+
- move.l (a0)+, (a1)+
- move.l (a0)+, (a1)+
- move.l (a0)+, (a1)+
- move.l (a0)+, (a1)+
- move.l (a0)+, (a1)+
- move.l (a0)+, (a1)+
- move.l (a0)+, (a1)+
- move.l (a0)+, (a1)+
- move.l (a0)+, (a1)+
- move.l (a0)+, (a1)+
- move.l (a0)+, (a1)+
- move.l (a0)+, (a1)+
- adda.w d1, a1 ; move source down a row
- dbra d0, @nextline ; loop
- _ShowCursor ; bring it back
- rts
-
- ;------MyPtInRect------
- ; Replacement for _PtInRect.
- ; ->a0 = Rect *r
- ; ->d0 = Point pt,
-
- @_MyPtInRect:
- moveq #0, d1
- cmp.w OFFSET(Rect, left)(a0), d0 ; compare (left, h)
- blt @ptNRect
- cmp.w OFFSET(Rect, right)(a0), d0 ; compare (right, h)
- bgt @ptNRect
- swap d0 ; try the vertical.
- cmp.w OFFSET(Rect, top)(a0), d0 ; compare (top, v)
- blt @ptNRect
- cmp.w OFFSET(Rect, bottom)(a0), d0 ; compare (bottom, v)
- bgt @ptNRect
- moveq #1, d1
- ptNRect: tst.b d1 ; set CCR for caller.
- rts
-
- ;------GetTrigValues------
- ; Determine the sine and cosine values for an angle using our trig table.
- ; <->a0 = *angle
- ; <->a1 = *sine
- ; <->a2 = *cosine
- ; uses a3, d0, d1
-
- @_GetTrigValues:
- cmpi.w #360*kAngleResolution, (a0) ; angle >= 360 degrees?
- blt @trig1 ; nope, branch
- addi.w #-360*kAngleResolution, (a0) ; subtract 360 degrees.
- bra @trig2
- trig1: tst.w (a0) ; angle < 0?
- bge @trig2 ; nope, branch
- addi.w #360*kAngleResolution, (a0) ; add 360 degrees to angle
-
- trig2: move.w (a0), d0 ; angle into d0
- movea.l gTrigTable, a3 ; trig table ptr into a3
-
- cmpi.w #90*kAngleResolution, d0 ; angle <= 90?
- bgt @trig180 ; nope, branch
- add.w d0, d0 ; address of value is 2*angle
- move.w (a3, d0.w), (a1) ; ie., new sine = gTrigTable[angle]
- move.w #180*kAngleResolution, d1 ; 90 * 2 = 180
- sub.w d0, d1 ; get inverse
- move.w (a3, d1.w), (a2) ; ie., new cosine = gTrigTable[90-angle]
- rts
-
- trig180: cmpi.w #180*kAngleResolution, d0 ; angle <= 180 degrees?
- bgt @trig270 ; nope, branch
- move.w #180*kAngleResolution, d1 ;
- sub.w d0, d1
- add.w d1, d1
- move.w (a3, d1.w), (a1) ; ie., new sine = gTrigTable[180-angle]
- addi.w #-90*kAngleResolution, d0
- add.w d0, d0
- move.w (a3, d0.w), (a2) ; ie., new cosine = -gTrigTable[angle-90]
- neg.w (a2)
- rts
-
- trig270: cmpi.w #270*kAngleResolution, d0 ; angle <= 270?
- bgt @trig360
- addi.w #-180*kAngleResolution, d0
- add.w d0, d0
- move.w (a3, d0.w), (a1) ; ie., new sine = -gTrigTable[angle-180]
- neg.w (a1)
- move.w #270*kAngleResolution, d0
- sub.w (a0), d0
- add.w d0, d0
- move.w (a3, d0.w), (a2) ; ie., new cosine = -gTrigTable[270-angle]
- neg.w (a2)
- rts
-
- trig360: move.w #360*kAngleResolution, d1
- sub.w d0, d1
- add.w d1, d1
- move.w (a3, d1.w), (a1) ; ie., new sine = -gTrigTable[360-angle]
- neg.w (a1)
- addi.w #-270*kAngleResolution, d0
- add.w d0, d0
- move.w (a3, d0.w), (a2) ; ie., new cosine = gTrigTable[angle-270]
- rts
-
- ;------CheckViewer------
- ; See if the viewer has moved by checking the mouse and keyboard.
- ; If moved the mouse, slice up the mouse into a velocity and angle factor, then
- ; grab the new sine and cosine values. Finally, find the new position
- ; in the x, y plane and if the 'q' or 'w' key is down, change the z position
- ; as well.
-
- @_CheckViewer:
- move.l 0x830, d0 ; Mouse=$830; processed mouse location [long] I-36
- lea @mouse, a3 ; temp holding
- move.l d0, (a3) ; save mouse position
- lea gBitMap.bounds, a0
- bsr @_MyPtInRect ; see if mouse is in window
- beq @endView; ; nope, branch
-
- addi.w #-kCenterH, OFFSET(Point, h)(a3) ; get difference
- addi.w #-kCenterV, OFFSET(Point, v)(a3)
-
- move.w OFFSET(Point, h)(a3), d0 ; get horizontal
- ext.l d0 ; clear upper 16 bits for divide
- divs #10, d0 ; slice it up
- add.w d0, gViewer.angle ; add to old angle
-
- move.w OFFSET(Point, v)(a3), d0 ; get vertical
- ext.l d0 ; clear upper 16 bits for divide
- divs #5, d0 ; slice it up
- neg.w d0 ; need to negate
- move.w d0, d7 ; save velocity in d7
-
- lea gViewer.angle, a0 ; set up to call routine
- lea gViewer.sine, a1
- lea gViewer.cosine, a2
- bsr @_GetTrigValues ; get the new sine/cosine
-
- move.w gViewer.sine, d0 ; the sine into d0
- muls d7, d0 ; mult by velocity
- divs #1000, d0 ; always divide by 1000
- add.w d0, gViewer.pt3D.x ; add to old x position
-
- move.w gViewer.cosine, d0 ; the cosine into d0
- muls d7, d0 ; mult by velocity
- divs #1000, d0 ; always divide by 1000
- add.w d0, gViewer.pt3D.y ; add to old y position
-
- move.l 0x174, d0 ; KeyMap=$174; keyboard bitmap (by code #) [2 longs] I-251
- btst #20, d0 ; 'q' key
- beq @testDn ; is it down?
- addq.w #3, gViewer.pt3D.z ; add some altitude to the z
- testDn: btst #21, d0 ; 'w' key
- beq @endView ; is it down?
- addi.w #-3, gViewer.pt3D.z ; subtract some altitude to the z
- endView: rts
-
- ;------Point2Screen------
- ; Rotate a point around the z axis and find it's location in 2D space.
- ; <->a0 = Point *pt
- ; uses d0, d1, d2
-
- @_Point2Screen:
- move.w gViewer.cosine, d0 ; [EQ.6]
- muls OFFSET(Point, h)(a0), d0 ; pt.h * cosine
- divs #1000, d0 ; divide by 1000
- move.w gViewer.sine, d1
- muls OFFSET(Point, v)(a0), d1 ; pt.v * sine
- divs #1000, d1 ; divide by 1000
- sub.w d1, d0 ; subtract the two, yielding the new horizontal
-
- move.w gViewer.sine, d1 ; [EQ.7]
- muls OFFSET(Point, h)(a0), d1 ; pt.h * sine
- divs #1000, d1 ; divide by 1000
- move.w gViewer.cosine, d2
- muls OFFSET(Point, v)(a0), d2 ; pt.v * cosine
- divs #1000, d2 ; divide by 1000
- add.w d2, d1 ; add the two, yielding the new vertical
- bgt @project ; if (vertical <= 0) then vertical = 1
- moveq #1, d1
-
- project: muls #kProjDistance, d0 ; [EQ.8]. new horizontal * kProjDistance
- divs d1, d0 ; divide by the vertical
- addi.w #kCenterH, d0 ; add origin.h (center of window)
- move.w d0, OFFSET(Point, h)(a0) ; save the new horizontal position
-
- move.w #kProjDistance, d0 ; [EQ.9]
- muls gDelta.z, d0 ; height * kProjDistance
- divs d1, d0 ; divide by the vertical
- addi.w #kCenterV, d0 ; add origin.v (center of window)
- move.w d0, OFFSET(Point, v)(a0) ; save the new vertical position
- rts
-
- ;------RotateObject------
- ; Rotate an object around the z axis and translate it to the
- ; correct position based on delta.
- ; ->a4 = ObjectInfo *object
- ; uses a0, a1, a2, a6, d0, d1, d2
-
- @_RotateObject:
- link a6, #-8 ; tempPt = -2(a6), sine = -6(a6), cosine = -8(a6)
- moveq #-6*kAngleResolution, d0 ; pyraminds rotate by -6
- cmpi.b #1, OFFSET(ObjectInfo, objType)(a4) ; is it a pyramid?
- beq @addAngle ; nope, branch
- moveq #2*kAngleResolution, d0 ; cubes rotate by 2
- addAngle: add.w d0, OFFSET(ObjectInfo, angle)(a4) ; add to old angle
-
- lea OFFSET(ObjectInfo, angle)(a4), a0 ; the angle
- lea -6(a6), a1 ; the sine
- lea -8(a6), a2 ; the cosine
- bsr @_GetTrigValues ; get the sine and cosine of angle
-
- tst.b OFFSET(ObjectInfo, moves)(a4) ; does object move?
- beq @rotate ; nope, branch
-
- move.w -6(a6), d0 ; sine into d0
- muls #20, d0 ; velocity = 20
- divs #1000, d0 ; divide by 1000
- add.w d0, OFFSET(ObjectInfo, pt3D.x)(a4); update new position x
- move.w -8(a6), d0 ; cosine into d0
- muls #-20, d0 ; velocity
- divs #1000, d0 ; divide by 1000
- add.w d0, OFFSET(ObjectInfo, pt3D.y)(a4) ; update new y
-
- rotate: moveq #3, d2 ; loop counter (vertices 0 to 3)
- lea gVertex, a0 ; our array of points
-
- rtLoop: move.l (a0), -4(a6) ; tempPt = gVertex[i];
- move.w -6(a6), d0 ; (sine) compute new vertical
- muls -2(a6), d0 ; tempPt.h*sine
- divs #1000, d0 ; divide by 1000
- move.w -8(a6), d1 ; cosine
- muls -4(a6), d1 ; tempPt.v*cosine
- divs #1000, d1 ; divide by 1000
- add.w d1, d0 ; add em up
- add.w gDelta.y, d0 ; now translate from origin
- move.w d0, (a0)+ ; new v position in space
-
- move.w -8(a6), d0 ; (cosine) compute new horizontal
- muls -2(a6), d0 ; tempPt.h
- divs #1000, d0 ; divide by 1000
- move.w -6(a6), d1 ; sine
- muls -4(a6), d1 ; tempPt.v*sine
- divs #1000, d1 ; divide by 1000
- sub.w d1, d0 ; subtract the two
- add.w gDelta.x, d0 ; now translate from origin
- move.w d0, (a0)+ ; new h position in space
-
- dbra d2, @rtLoop ; loop
- unlk a6 ; kill stackframe
- rts
-
- ;------DrawObjects------
- ; For all of our cubes and pyramids, index thru each
- ; and calculate sizes, translate, rotate, check for visibility,
- ; and finally draw them.
- ; uses a0, a3, a4, d0, d1, d3, & d7 <- (loop counter)
-
- @_DrawObjects
- clr.w d7 ; d7 is our loop counter
- objloop: move.w d7, d0 ; start to compute address of object
- asl.w #4, d0 ; multiply by 16 (size of record)
- lea gObject, a4 ; our array
- adda.w d0, a4 ; address of object
-
- move.w OFFSET(ObjectInfo, pt3D.x)(a4), d0 ; [EQ.3]
- sub.w gViewer.pt3D.x, d0 ; pt.x - viewer.x
- move.w d0, gDelta.x ; save in delta.x
-
- move.w OFFSET(ObjectInfo, pt3D.y)(a4), d0 ; [EQ.4]
- sub.w gViewer.pt3D.y, d0 ; pt.y - viewer.y
- move.w d0, gDelta.y ; save in delta.y
-
- move.w gViewer.pt3D.z, d0 ; [EQ.5]
- sub.w OFFSET(ObjectInfo, pt3D.z)(a4), d0
- move.w d0, gDelta.z ; save in delta.z
-
- tst.b OFFSET(ObjectInfo, rotates)(a4) ; do we rotate this one?
- beq @staticObj ; nope, branch
-
- move.w OFFSET(ObjectInfo, halfWidth)(a4), d0
- move.w d0, gVertex[1].h
- move.w d0, gVertex[2].h
- move.w d0, gVertex[2].v
- move.w d0, gVertex[3].v
- neg.w d0
- move.w d0, gVertex[0].h
- move.w d0, gVertex[0].v
- move.w d0, gVertex[1].v
- move.w d0, gVertex[3].h
-
- bsr @_RotateObject ; go rotate object at origin
- bra @chkType
-
- staticObj: move.w OFFSET(ObjectInfo, halfWidth)(a4), d0
- neg.w d0
- move.w d0, d1
- add.w gDelta.x, d0
- add.w gDelta.y, d1
- move.w d0, gVertex[0].h
- move.w d0, gVertex[3].h
- move.w d1, gVertex[0].v
- move.w d1, gVertex[1].v
- move.w OFFSET(ObjectInfo, halfWidth)(a4), d0
- move.w d0, d1
- add.w gDelta.x, d0
- add.w gDelta.y, d1
- move.w d0, gVertex[1].h
- move.w d0, gVertex[2].h
- move.w d1, gVertex[2].v
- move.w d1, gVertex[3].v
-
- chkType: tst.b OFFSET(ObjectInfo, objType)(a4) ; what kind, cube or pyramid?
- beq @cube ; not a pyramid, branch
- move.w gDelta.x, gVertex[4].h ; assine the apex of the pyramid
- move.w gDelta.y, gVertex[4].v ; ditto
- bra @plotZero ; branch
-
- cube: move.l gVertex[0], gVertex[4] ; assign top plane of cube
- move.l gVertex[1], gVertex[5]
- move.l gVertex[2], gVertex[6]
- move.l gVertex[3], gVertex[7]
-
- plotZero: lea gVertex[0], a0 ; get vertex 0 first
- bsr @_Point2Screen ; rotate and plot on window.
-
- move.l gVertex[0], d0 ; get point
- lea gVisRect, a0 ; our visable rect
- bsr @_MyPtInRect ; check pt in rect…
- beq @next ; not visable, branch
-
- lea gVertex[1], a0 ; rotate and plot on window.
- bsr @_Point2Screen
- lea gVertex[2], a0 ; rotate and plot on window.
- bsr @_Point2Screen
- lea gVertex[3], a0 ; rotate and plot on window.
- bsr @_Point2Screen
-
- move.w gDelta.z, d0
- sub.w OFFSET(ObjectInfo, height)(a4), d0
- move.w d0, gDelta.z
- lea gVertex[4], a0 ; rotate and plot on window.
- bsr @_Point2Screen
-
- movea.l gLineToAddress, a3
- move.l gVertex[0], gAnimationPort.pnLoc ; connect the dots…
- move.l gVertex[1], -(sp)
- jsr (a3)
- move.l gVertex[2], -(sp)
- jsr (a3)
- move.l gVertex[3], -(sp)
- jsr (a3)
- move.l gVertex[0], -(sp)
- jsr (a3)
- move.l gVertex[4], -(sp)
- jsr (a3)
-
- tst.b OFFSET(ObjectInfo, objType)(a4)
- beq @drawcube ; not a pyramid, branch
-
- move.l gVertex[1], -(sp)
- jsr (a3)
- move.l gVertex[2], gAnimationPort.pnLoc
- move.l gVertex[4], -(sp)
- jsr (a3)
- move.l gVertex[3], -(sp)
- jsr (a3)
-
- bra @next
-
- drawcube: lea gVertex[5], a0 ; rotate and plot on window.
- bsr @_Point2Screen
- lea gVertex[6], a0 ; rotate and plot on window.
- bsr @_Point2Screen
- lea gVertex[7], a0 ; rotate and plot on window.
- bsr @_Point2Screen
-
- movea.l gLineToAddress, a3
- move.l gVertex[5], -(sp)
- jsr (a3)
- move.l gVertex[6], -(sp)
- jsr (a3)
- move.l gVertex[7], -(sp)
- jsr (a3)
- move.l gVertex[4], -(sp)
- jsr (a3)
- move.l gVertex[1], gAnimationPort.pnLoc
- move.l gVertex[5], -(sp)
- jsr (a3)
- move.l gVertex[2], gAnimationPort.pnLoc
- move.l gVertex[6], -(sp)
- jsr (a3)
- move.l gVertex[3], gAnimationPort.pnLoc
- move.l gVertex[7], -(sp)
- jsr (a3)
-
- next: addi.w #1, d7 ; increment counter
- cmpi.w #kMaxObjects, d7 ; last object?
- blt @objloop ; loop
- rts
-
- /********************************************************************/
-
- @mouse dc.l 0
- @elevenBlacks dc.l -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
- }
- }